@model IEnumerable<ExpertSMS.Models.StoreToKitchenEntry>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Date
        </th>
        <th>
            Store
        </th>
        <th>
            Kitchen
        </th>
        <th>
            StoreToKitchenEntryItems
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.StoreToKitchenEntryID }) |
            @Html.ActionLink("Details", "Details", new { id=item.StoreToKitchenEntryID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.StoreToKitchenEntryID })
        </td>
        <td>
			@String.Format("{0:g}", item.Date)
        </td>
        <td>
			@(item.Store == null ? "None" : item.Store.Name)
        </td>
        <td>
			@(item.Kitchen == null ? "None" : item.Kitchen.Name)
        </td>
        <td>
			@(item.StoreToKitchenEntryItems == null ? "None" : item.StoreToKitchenEntryItems.Count.ToString())
        </td>
    </tr>
}

</table>


